Array.prototype.mypush = function(){
    //1.将参数追加到数组的末尾 this,arguments
    //浅拷贝
    /*
    var origin = this;
    for(var i=0;i<arguments.length;i++){
        this[this.length] = arguments[i];
    }
    return this.length;
    */
    //深拷贝
    var origin = JSON.parse(JSON.stringify(this));
    for(var i=0;i<arguments.length;i++){
        origin[origin.length] = arguments[i];
    }
    return origin;
}


var arr = ["moyu","momo","tom"];
console.log("追加之前",arr)
var arr1 = arr.mypush("vicky","jack");
console.log("追加之后",arr);
console.log("返回值",arr1);
